/*
 * Copyright 2002-2010 Edward L. Stauff.                  Contact: <EdStauff@gmail.com>.
 * 
 * This file, "IProgressReporter.cs", is part of the "Stauffware.Common" 
 * library.
 * "Stauffware.Common" is free software: you can redistribute it and/or 
 * modify it under the terms of the GNU Lesser Public License as published by the 
 * Free Software Foundation, either version 3 of the License, or (at your option) 
 * any later version.
 * 
 * "Stauffware.Common" is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser Public License for more 
 * details.
 * 
 * You should have received a copy of the GNU Lesser Public License along with 
 * the "Stauffware.Common" sources.  If not, see <http://www.gnu.org/licenses/>.
 */

using System;

namespace Stauffware.Common.Core
{
	/// <summary>
	/// Generic interface for reporting progress.
	/// </summary>
	public interface IProgressReporter
	{
		/// <summary>
		/// Log an error.
		/// </summary>
		/// <remarks>
		/// The implementation of this method should add any appropriate prefix
		/// such as "*** ERROR: "; callers of this method should not.
		/// </remarks>
		void LogError (string descr);

		/// <summary>
		/// Log an exception.
		/// </summary>
		/// <remarks>
		/// The implementation of this method should add any appropriate prefix
		/// such as "*** EXCEPTION: "; callers of this method should not.
		/// </remarks>
		void LogException (Exception x);

		/// <summary>
		/// Log an exception.
		/// </summary>
        /// <param name="x"></param>
		/// <param name="context">descriptive info about where the exception occurred</param>
		/// <remarks>
		/// The implementation of this method should add any appropriate prefix
		/// such as "*** EXCEPTION: "; callers of this method should not.
		/// </remarks>
		void LogException (Exception x, string context);

		/// <summary>
		/// Log a warning.
		/// </summary>
		/// <remarks>
		/// The implementation of this method should add any appropriate prefix
		/// such as "* WARNING: "; callers of this method should not.
		/// </remarks>
		void LogWarning (string descr);

		/// <summary>
		/// Log a line of text.
		/// </summary>
		void LogLine (string descr);

		/// <summary>
		/// Log text (without an implicit newline).
		/// </summary>
		void Log (string text);

		/// <summary>
		/// Increase indentation by 1 level
		/// </summary>
		void Indent ();

		/// <summary>
		/// Decrease indentation by 1 level
		/// </summary>
		void Outdent ();

		/// <summary>
		/// Remove all indentation levels.
		/// </summary>
		void OutdentAll ();

		/// <summary>
		/// Clears the progress report.
		/// </summary>
		void Clear();

		/// <summary>
		/// The number of errors encountered.
		/// </summary>
		int ErrorCount { get; set; }

		/// <summary>
		/// The number of warnings encountered.
		/// </summary>
		int WarningCount { get; set; }
	}
}